﻿using System;
using System.Collections.Generic;

namespace Delphi.Mimir.Data.Entities.Final {
    public class Symbol {
        public Symbol() {
            Quotes = new List<Quote>();
            CorporateActions = new List<CorporateAction>();
            Fundamentals = new List<Fundamentals>();
        }
        public int SymbolId { set; get; }
        public string Code { set; get; }
        public string Name { set; get; }
        public int ExchangeId { set; get; }
        public virtual Exchange Exchange { set; get; }
        public string ShortLable {
            get {
                return string.Format("{0}:{1}", Code, Exchange.Code);
            }
        }
        public string LongLable {
            get {
                return string.Format("{0}:{1} - {2}", Code, Exchange.Code, Name);
            }
        }
        public DateTime ValidFromDate { set; get; }
        public DateTime ValidTilDate { set; get; }
        public DateTime? LastLoadDate { set; get; }
        public virtual ICollection<Quote> Quotes { set; get; }
        public bool? IsYahoo { set; get; }
        public string YahooCode { set; get; }
        // Bug fix 4: Avoid using google_fg for yahoo processing --> new flag
        public bool? IsYahooProcessed { set; get; }
        public bool? IsGoogle { set; get; }
        public string GoogleCode { set; get; }
        public virtual ICollection<CorporateAction> CorporateActions { set; get; }
        public virtual ICollection<Fundamentals> Fundamentals { set; get; }
    }
}
